package com.xj.demo.classcommand;

public class IfSwitchGotoTest {
    public void ifCompare1(){
        int a = 1;
        int b = 2;
        if (a > b) {
            System.out.println(11);
        }

        if (a == 0) {
            System.out.println(22);
        }
    }

    public void ifCompare2(){
        int a = 1;
        long b = 2L;
        System.out.println(a > b);
    }

    public void switchTest(int num){
        switch (num){
            case 1:
                System.out.println(1);
                break;
            case 8:
                System.out.println(2);
                break;
            case 3:
                System.out.println(3);
                break;
            case 7:
                System.out.println(7);
                break;
            default:
                System.out.println("default");
                break;
        }
    }
}
